package com.xmy.cultivate.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xmy.cultivate.converter.LocalDateConverter;
import com.xmy.cultivate.converter.LocalDateTimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 缺课记录
 * </p>
 *
 * @author hpiggy
 * @since 2023-07-28
 */
@TableName("lack_course_log")
@ApiModel(value = "LackCourseLog对象", description = "缺课记录")
@Data
public class LackCourseLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore
    private Long id;

    @ExcelIgnore
    @ApiModelProperty("所属校区")
    private Long schoolId;

    @ExcelIgnore
    private Integer lessonType;

    @ExcelIgnore
    private Integer lessonNum;

    @ExcelIgnore
    @ApiModelProperty("科目id")
    private Long subjectsId;

    @ExcelIgnore
    @ApiModelProperty("班级id")
    private Long gradeId;

    @ExcelIgnore
    @ApiModelProperty("学生id")
    private Long studentId;

    @ExcelIgnore
    @ApiModelProperty("年份")
    private Integer yearPart;

    @ExcelIgnore
    @ApiModelProperty("学期")
    private Integer quarterNum;

    @ExcelIgnore
    @ApiModelProperty("年段，0少儿，1小学，2初中，3高中")
    private Integer gradeSection;

    @ExcelIgnore
    @ApiModelProperty("年级")
    private Integer yearClassId;

    @TableField(exist = false)
    @ExcelProperty(index = 4,value = "年级")
    private String yearClassStr;



    @TableField(exist = false)
    @ExcelProperty(index = 5,value = "班型")
    private String classTypeName;

    @ExcelIgnore
    @ApiModelProperty("是否签到：0否，1是(这里签到时候用的)")
    private Integer isSignIn;

    @ExcelIgnore
    @ApiModelProperty("0未上，1已上")
    private Integer status;

    @ExcelIgnore
    @ApiModelProperty("缺的是哪个日常课id（对应总排课id）")
    private Long schedulingAlwaysId;

    @ExcelIgnore
    @ApiModelProperty("1正常报名，5是转校")
    private Integer type;

    @ExcelIgnore
    @ApiModelProperty("0是功能更新前数据，功能更新后：1为分班缺课，2停课复课缺课")
    private Integer lackType;

    @ExcelIgnore
    @ApiModelProperty("备注")
    private String remark;

    @ExcelIgnore
    @ApiModelProperty("0未安排 1已补课 2已安排")
    private Integer isRepair;

    @ExcelIgnore
    @ApiModelProperty("repair表id，安排的补课id")
    private Long repairId;


    @ExcelProperty(index = 9,value = "补课日期",converter = LocalDateTimeConverter.class)
    @ApiModelProperty("安排的补课信息结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime repairEndDateTime;

    @ExcelIgnore
    @TableLogic
    private Integer deleted;

    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @ExcelIgnore
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    @ExcelProperty(index = 8,value = "教师名称")
    @ApiModelProperty("教师名称")
    @TableField(exist = false)
    private String teacherName;

    @ExcelIgnore
    @ApiModelProperty("补课日期")
    @TableField(exist = false)
    private LocalDate schoolDate;

    @ExcelProperty(index = 2,value = "学员名称")
    @ApiModelProperty("学生名称")
    @TableField(exist = false)
    private String studentName;

    @ExcelProperty(index = 3,value = "班级")
    @ApiModelProperty("班级名称")
    @TableField(exist = false)
    private String gradeName;

    @ExcelProperty(index = 10,value = "补课状态")
    @ApiModelProperty("补课状态")
    @TableField(exist = false)
    private String isRepairStr;

    @ExcelProperty(index = 0,value = "上课日期", converter = LocalDateConverter.class)
    @ApiModelProperty("开始日期")
    @TableField(exist = false)
    private LocalDate startDate;

    @ExcelIgnore
    @ApiModelProperty("结束日期")
    @TableField(exist = false)
    private LocalDate endDate;

    @ExcelProperty(index = 7,value = "缺课课次")
    @ApiModelProperty("课次")
    @TableField(exist = false)
    private Integer num;

    @ExcelIgnore
    @ApiModelProperty("课程id")
    @TableField(exist = false)
    private Long courseId;

    @ExcelIgnore
    @ApiModelProperty("课程名称")
    @TableField(exist = false)
    private String courseName;

    @ExcelIgnore
    @TableField(exist = false)
    private String repairDateStr;

    @ExcelIgnore
    @TableField(exist = false)
    private String passRepairDateStr;

    @ExcelIgnore
    @TableField(exist = false)
    private String repairGradeName;

    @ExcelIgnore
    @TableField(exist = false)
    private String repairTeacherName;

    @ExcelProperty(index = 6,value = "科目")
    @TableField(exist = false)
    private String subjectsName;

    @ExcelIgnore
    @TableField(exist = false)
    private String classDate;

    /**
     * 转出班级id(记录转校时自动创建班级是否已经创建)
     */
    @ExcelIgnore
    private Long outId;

    /**
     * 转出校区详情id
     */
    @ExcelIgnore
    private Long changeSchoolDetailId;

    @ExcelIgnore
    @TableField(exist = false)
    private Long classTypeId;

    @ExcelIgnore
    @TableField(exist = false)
    private String timeStart;

    @ExcelIgnore
    @TableField(exist = false)
    private String timeEnd;

    @ExcelProperty(index = 1, value = "上课时段")
    @TableField(exist = false)
    private String schoolTime;

}
